package com.tonghe.controller;

import com.tonghe.annotation.SystemLog;
import com.tonghe.domain.ResponseResult;
import com.tonghe.service.UploadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
 * @Date:2022/3/14- 03- 14- 21:58
 * @author: tonghe
 **/
@RestController
public class UploadCntroller {

    @Autowired
    private UploadService uploadService;

    /**
    * @description: 上传头像
    */
//    @SystemLog(businessName = "用户上传头像")
    @PostMapping("upload")
    public ResponseResult uploadImg(MultipartFile img) throws IOException {
        return uploadService.uploadImg(img);
    }

}
